﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace HZ.DrugTrade.Web
{
    public partial class GoodsInfo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                Bind();
            }
        }
        public void Bind()
        {
            string goodsid ="";
            if(Request.QueryString["goodsid"] != null)
            {
                goodsid = Request.QueryString["goodsid"];
            }
            HZ.DrugTrade.Model.Goods goods = HZ.DrugTrade.BLLFactory.Factory.BLL_Goods().GetGoodsInfoByWhere(goodsid);
            lblGoodsID.Text = goods.GoodsID;
            lblGoodsName.Text = goods.GoodsName;
            lblOutlookcModel.Text = goods.Outlookc;
            lblProductMaterial.Text = goods.Material;
            lblBrand.Text = goods.Brand;
            lblStandardName.Text = goods.StandardName;
            lblStandardId.Text = goods.StandardId;
            lblCompanyName_SC.Text = goods.CompanyName_SC;
            lblMinUnit.Text = goods.Unit;
            lblQuality2.Text = goods.QualityLevel;
            lblQuality1.Text = goods.CPRZTX;
            lblRegCode.Text = goods.RegCode;
            lblRegName.Text = goods.RegName;
            lblRegDate.Text = goods.RegDate.ToString();
            lblRegisterTime.Text = goods.RegisterTime.ToString();
            lblCOMPANYADDRESS_SC.Text = goods.COMPANYADDRESS_SC;
            lblCOMPANYLOCALADDRESS_SC.Text = goods.COMPANYLOCALADDRESS_SC;
            lblProApplication.Text = goods.ProApplication;
            lblPerformance.Text = goods.Performance;
            if (!string.IsNullOrEmpty(goods.picurl))
            {
                string strUrl = goods.picurl.Replace("&nbsp;&nbsp;", "$");
                string[] url = strUrl.Split(new char[] { '$' });
                string Strhtml = "";

                foreach (string s in url)
                {

                    if (s.Trim() != "")
                        Strhtml += "&nbsp;&nbsp;" + s;
                }
                this.div_pic.InnerHtml = Strhtml;
            }
        }
    }
}